try:
    from io import BytesIO as StringIO
except ImportError:
    from cStringIO import StringIO